package com.jims.master.modules.api.weixin.web;

import com.jims.master.common.data.StringData;
import com.jims.master.modules.doctor.entity.PatMasterIndex;
import com.jims.master.modules.doctor.service.PatMasterIndexService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by chenxy on 2017/5/12.
 */

@Controller
@RequestMapping(value = "${adminPath}/wx/api")
public class WxController {


    @Autowired
    private PatMasterIndexService patMasterIndexService;


    //1 pat_master_index 插入数据
    @RequiresPermissions("user")
    @RequestMapping(value="/savePatIndex/{name}{idCard}{cell}",method= RequestMethod.POST)
    @ResponseBody
    public StringData savePatIndex(@PathVariable("name") String name,@PathVariable("idCard") String idCard,@PathVariable("cell") String cell){
        StringData stringData=new StringData();
        PatMasterIndex patMasterIndex=new PatMasterIndex();
        int i=patMasterIndexService.save(patMasterIndex);
        if(i>0){
            stringData.setCode("success");
            stringData.setData("操作成功！");
        }else{
            stringData.setCode("error");
            stringData.setData("操作失败！");
        }
        return stringData;
    }
    //2 挂号数据保存




    //3 ....


}
